import request from '@/utils/request'

export function login(data) {
  return request({
    url: '/product/login',
    method: 'post',
    data
  })
}
export function regist(data) {
  return request({
    url: '/product/regist',
    method: 'post',
    data
  })
}

export function Sale(params = {}) {
  return request.get('/product/list', { params: params })
}

export function Collage() {
  return request({
    url: '/product/list',
    method: 'get',
    data: {
      discounts: 1
    }
  })
}
export function cateGory(params) {
  return request({
    url: '/product/category',
    method: 'get',
    params
  })
}

export function cateGory1() {
  return request({
    url: '/product/category',
    method: 'get',
    data: {
      category: 1
    }
  })
}
export function getTopic(params = {}) {
  return request.get('/product/goodsDetails', { params: params })
}
export function getComment(params = {}) {
  return request.get('/product/shopDetails', { params: params })
}
export function getComment1(params = {}) {
  return request.get('/product/pinglun', { params: params })
}
export function addCar(data = {}) {
  return request.post('shopcart/add', data)
}
//直播封面
export function homeOne(params={}){
  return request.get('/product/list',{params:params})
}

export function getLiveCover(){
  return request.get('/video/getLiveCover')
}
export function getVideo(id) {
  return request.get('/video/getVideo', { params: { id } })
}
export function getLive(params = {}) {
  return request.get('/video/getVideo', { params: params })
}
export function User(params = {}) {
  return request.get('/product/getUserInfo', { params: params })
}
export function getCar(params = {}) {
  return request.get('/shopcart/list', { params: params })
}

export function deleteCart(params){
  return request.delete('/shopcart/deleteCart',{params})
}
	//订单信息
export function orderInformation(params){
	return request({
		url:'/product/order',
		method:'get',
		params
	})
} 
//listAddr
export function listAdd(params={}){
	return request.get('/useraddr/getAll',{params:params})
}
//删除地址
export function delAdd(data={}){
	return request.post('/useraddr/shanchudizhi',data)
}
//修改地址
export function editAdd(data={}){
	console.log(data,",,,");
	return request.post('/useraddr/xiugaidizhi',data)
}

//新增地址
export function newAdd(data={}){
	return request.post('/useraddr/xinzengdizhi',data)
}

export function getVideoAll(params={}){
  return request.get('/video/getVideoAll',params)
}
